<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>根据区域设置格式化 GMT/UTC 时间／日期</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.gmstrftime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmstrftime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">gmstrftime</span> &mdash; <span class="dc-title">
   根据区域设置格式化 GMT/UTC 时间／日期
  </span></p>

 </div>
 <div class="refsect1 unknown-unknown-unknown-examplev" id="refsect1-function.gmstrftime-unknown-unknown-unknown-examplev">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmstrftime</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$format</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$timestamp</code></span>
  ] ) : <span class="type">string</span></div>

  <p class="para rdfs-comment">
   和 <span class="function"><a href="strftime.html" class="function">strftime()</a></span>
   的行为相同，只除了返回时间是格林威治标准时（GMT）。例如，当在东部标准时（EST，GMT
   -500）运行时，下面第一行显示“Dec 31 1998 20:00:00”，而第二行显示“Jan 01 1999
   01:00:00”。
   <div class="example" id="example-2724">
    <p><strong>Example #1 <span class="function"><strong>gmstrftime()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'en_US'</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%b&nbsp;%d&nbsp;%Y&nbsp;%H:%M:%S"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">mktime&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">20</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">12</span><span style="color: #007700">,</span><span style="color: #0000BB">31</span><span style="color: #007700">,</span><span style="color: #0000BB">98</span><span style="color: #007700">)).</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo&nbsp;</span><span style="color: #0000BB">gmstrftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%b&nbsp;%d&nbsp;%Y&nbsp;%H:%M:%S"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">mktime&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">20</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">12</span><span style="color: #007700">,</span><span style="color: #0000BB">31</span><span style="color: #007700">,</span><span style="color: #0000BB">98</span><span style="color: #007700">)).</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
  <p class="para">
   参见 <span class="function"><a href="strftime.html" class="function">strftime()</a></span>。
  </p>
 </div>

</div></div></div></body></html>